home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 2 / LSD and 17bit Compendium Deluxe - Volume II.iso / a / prog / amigae / autobuild11.lha / AutoBuild / AutoBuild.doc next >
Encoding:
Text File  |  1994-11-27  |  14.0 KB  |  307 lines

  1.                        *****************************
  2.                        *       Autobuild v1.1      *
  3.                        * © 1994 Jan Hendrik Schulz *
  4.                        *****************************
  5.  
  6.                                Indroduction
  7.                                ~~~~~~~~~~~~
  8.    What is autobuild? Autobuild is an automatic build tool for AmigE. It
  9. can do the same think like the build tool that came with AmigaE v3 if it is
  10. used to build programms which are splitted over several modules, but it
  11. does it automaticly. That meens, you need no .build-file to define the
  12. dependencies etc.
  13.    Additionaly if you use Mac2E you can (must) define the macrofiles that
  14. are needed with a new keyword (MACROS) directly in the source. And you can
  15. define whole macros in the source,too.
  16.  
  17.  
  18.                                  History
  19.                                  ~~~~~~~
  20. v1.0   - First public release
  21.  
  22. v1.1   - Sources without PROC and EXPORT causing no error anymore.
  23.        - v1.0 doesn't noticed a failing EC or Mac2E sometimes and doesn't
  24.          stop. I hope, this bug is fixed now.
  25.       (- No important changes in this doc-file. You don't need to read
  26.          this docs, if you allready had read the v1.0 docs.)
  27.  
  28.  
  29.                     Why using autobuild and not build?
  30.                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  31.    If you are writing a big program and splitt the source into several
  32. modules, you have to change the .build-file everytime when you introduce
  33. a new module, or if a source after some changes needs other modules (or
  34. macrofiles, if you use Mac2E).
  35.    With autobuild, if you have changed the MODULE information in the source,
  36. autobuild sees automaticly the new dependence and acts accordingly. And if
  37. you use Mac2E and your source needs another macrofile, it's easier (I think)
  38. to add the name of this macrofile into the source and not into an extra
  39. .build-file.
  40.    Or if you need a (simple) macro only with one source, with autobuild you
  41. can define it directly in this source if you want. You don't have to create
  42. an extra macrofile for it (autobuild does this for you).
  43.    And last but not least, unlike build, autobuild sees circular dependen-
  44. cies between the files. And if you call it with FORCE, every file is still
  45. builded only once!
  46.  
  47.  
  48.                               Requirements
  49.                               ~~~~~~~~~~~~
  50.    To use autobuild you need Kickstart 2.04 or better, AmigaE and maybe
  51. Mac2E if you want to use macros.
  52.  
  53.  
  54.                           How to use autobuild?
  55.                           ~~~~~~~~~~~~~~~~~~~~~
  56.    Autobuild must be called from the shell and it has the following syntax:
  57.  
  58.      TARGET,FORCE=F/S,PRIVATONLY=PO/S,QUIET=Q/S,ECOPTS=EO/K,ECPATH=EP/K,
  59.      MACOPTS=MO/K,MACPATH=MP/K,MACQUIET=MQ/S
  60.  
  61. TARGET      is the name of the file that should be build. (Without the .m
  62.             if it is a module!)
  63.  
  64. FORCE       tells autobuild to build all files, even if they are allready
  65.             uptodate. (Even with FORCE, every file is build only once!)
  66.  
  67. PRIVATONLY  Normaly autobuild compares the filedate of EVERY used module
  68.             and macrofile with the filedate of the target to find out, if
  69.             the target is up to date (newer). If you use PRIVATONLY, only
  70.             the private modules and macrofiles (those which names starting
  71.             with a *) are testet and not those in EMODULES: and EMACROS:
  72.  
  73. QUIET       Only error-messages (and the output of EC and Mac2E) are
  74.             printed.
  75.  
  76. ECOPTS      here you can give additional arguments for the EC-call. You
  77.             should write doublequotes around them! Autobuild calls EC like
  78.             this: EC <file> <ecopts>
  79.             Example: autobuild target ECOPTS "QUIET"
  80.  
  81. ECPATH      You can tell autobuild where to find EC and than autobuild
  82.             copies EC to RAM:EC (if needed) and uses RAM:EC instead of EC.
  83.             Example: autobuild target ECPATH "Work:AmigaE/Bin/EC"
  84.  
  85. MACOPTS     Like ECOPTS but for the Mac2E call. Autobuild calls Mac2E like
  86.             this: Mac2E <source.em> <source.e> <macopts> WITH <macrofiles>
  87.  
  88. MACPATH     Like ECPATH but for Mac2E.
  89.  
  90. MACQUIET    tells autobuild to redirect the output of Mac2E to a temporary
  91.             file (t:mac2eout). This file is only (but automaticly) shown if
  92.             the Mac2E-call wasn't successfull.
  93.  
  94.  
  95.                           The .autobuild file
  96.                           ~~~~~~~~~~~~~~~~~~~
  97.    To make the autobuild call easier, autobuild looks for a file called
  98. ".autobuild" in the currend directory and if it exists, the first line of
  99. this file is passed through ReadArgs() with the template above. So normaly
  100. you can execute autobuild without any arguments. If you use arguments and
  101. additionaly there is a .autobuild-file, both are mixed like this:
  102.  
  103. TARGET, ECOPTS, ECPATH, MACOPTS and MACPATH:
  104.    If you give them with the commandline, the corresponding .autobuild
  105.    setting is ignored.
  106.    
  107. FORCE, PRIVATEONLY, QUIET and MACQUIET:
  108.    The commandline and the .autobuild-settings are Eor()ed.
  109.  
  110.  
  111.                         How does autobuild work?
  112.                         ~~~~~~~~~~~~~~~~~~~~~~~~
  113.    To see, how autobuild works, I think it's the best way to show you how
  114. the most important PROC of autobuild - build() - works. If you call
  115. autobuild e.g. with 'autobuild abc' than main() calls after some initial
  116. work build() with 'abc' as target. And build() works like this:
  117.  
  118.                         *-----------------------*
  119.                         |   PROC build(target)  |
  120.                         *-----------+-----------*
  121.                                     |
  122.                         ?-----------+-----------?
  123.                  +--NO--+ Exists 'target.em' ?  +--YES--+
  124.                  |      ?-----------------------?       |
  125.                  |                                      |
  126.   +--------------+--------------+        +--------------+--------------+
  127.   | Look into 'target.e' to see |        | Look into 'target.em' to see|
  128.   | which emodules are used by  |        | which emodules and which    |
  129.   | this source.                |        | macrofiles are used, and to |
  130.   +--------------+--------------+        | create, if necessary, a tmp.|
  131.                  |                       | macrofile from the macrodefs|
  132.                  |                       | in the source.              |
  133.                  |                       +--------------+--------------+
  134.                  |                                      |
  135.                  |                       ?--------------+--------------?
  136.                  |               +---NO--+     Exists 'target.e' ?     |
  137.                  |               |       ?--------------+--------------?
  138.                  |               |                      | YES
  139.                  |               |       ?--------------+--------------?
  140.                  |               |       |  Is 'target.em' newer than  |
  141.                  |               +--YES--+        'target.e' ?         |
  142.                  |               |       ?--------------+--------------?
  143.                  |               |                      | NO
  144.                  |               |       ?--------------+--------------?
  145.                  |               |       | Is at least one of the used |
  146.                  |               +--YES--+    macrofiles newer than    |
  147.                  |               |       |  'target' (or 'target.m') ? |
  148.                  |                \      ?--------------+--------------?
  149.                  |                 \                    | NO
  150.                  |   +--------------+--------------+    |
  151.                  |   | Call Mac2E to build an up   |    |
  152.                  |   | to date 'target.e'-file     |    |
  153.                  |   +--------------+--------------+    |
  154.                  |                  |                   |
  155.                  +----------------+ | +-----------------+
  156.                                    \|/
  157.                      +--------------+--------------+
  158.                      | Call build() for every used |
  159.                      | privat emodule to make them |
  160.                      | up to date if necessary     |
  161.                      +--------------+--------------+
  162.                                     |
  163.                      ?--------------+--------------?
  164.                      |      Exists 'target'        |
  165.              +---NO--+     (or 'target.m') ?       |
  166.              |       ?--------------+--------------?
  167.              |                      | YES
  168.              |       ?--------------+--------------?
  169.              |       |  Is 'target.e' newer than   |
  170.              +--YES--+ 'target' (or 'target.m') ?  |
  171.              |       ?--------------+--------------?
  172.              |                      | NO
  173.              |       ?--------------+--------------?
  174.              |       | Is at least one of the used |
  175.              +--YES--+ emodules newer than 'target'|
  176.               \      |      (or 'target.m') ?      |
  177.                \     ?--------------+--------------?
  178.                 \                   | NO
  179.    +-------------+-------------+    |
  180.    | Call EC to build an up to |    |
  181.    | date 'target'-file        |    |
  182.    | (or 'target.m'-file )     |    |
  183.    +-------------+-------------+    |
  184.                  |                  |
  185.                  +----------------+ |
  186.                                    \|
  187.                                 *---+---*
  188.                                 |  END  |
  189.                                 *-------*
  190.  
  191.    The above shoud only give an idea what the PROC build() does. The real
  192. PROC build() works a little bit different! It has some lists in memory to
  193. build every file only once, and to look for the filedate of a file only
  194. once for example, but the result is the same.
  195.  
  196.  
  197.                  How to define macrofiles and macros?
  198.                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  199.    First, if you have a source with macros, it's name must end with '.em'!
  200. Autobuild then calls Mac2E to build the '.e'-file. To define which macro-
  201. files should be used, there is the new keyword MACROS. Use this keyword
  202. like the AmigaE keyword MODULE:
  203.    Write MACROS 'abc.pma' to use the macrofile 'EMACROS:abc.pma'. And
  204. write MACROS '*abc.pma' to use the macrofile '<sourcedir>abc.pma'.
  205.  
  206. Example:
  207.  
  208.   MACROS 'abc.pma', '*xyz.pma',  -> You can use a comment here...
  209.        /*  ... or here ... */
  210.          '*macros.ma'            -> ...or here!
  211.  
  212.  
  213.    To define a macro directly in the source, autobuild uses a more E-like
  214. syntax than Mac2E. There are two ways:
  215.  
  216.   MACRO name IS body
  217.  
  218.   MACRO name
  219.   body
  220.   ENDMACRO
  221.  
  222.   To see, how to use this, now some examples on the left side and the Mac2E
  223. version that is builded by autobuild for the Mac2E call on the right side:
  224.                                      |
  225. MACRO test IS 10                     |#define test 10
  226.                                      |
  227. MACRO abc(x,y,z) IS a+b+c -> comment |#define abc(x,y,z) a+b+c
  228.                                      |
  229. MACRO xyz IS /* comment              |#define xyz XYZ
  230.    */   XYZ                          |
  231.                                      |
  232. MACRO blah                           |#define blah\
  233.   first line -> with comment         |first line\
  234.  abc /* comment */ xyz               |abc\
  235.       LAST LINE                      |xyz\
  236.    -> empty line                     |LAST LINE
  237. ENDMACRO                             |
  238.  
  239.  
  240.                           Some important infos!
  241.                           ~~~~~~~~~~~~~~~~~~~~~
  242. -  All the MACRO and MACROS stuff above must be in comments to have no
  243. problems with the E-compiler. Simply put a line with /* before it and a
  244. line with */ behind it. Example:
  245. /*
  246. MACROS 'test.pma'
  247.  
  248. MACRO abc IS xyz
  249. */
  250.  
  251. -  Autobuild reads the source only until it finds the first PROC or EXPORT
  252. keyword to make things faster. Is there no PROC or EXPORT, the whole file
  253. is read.
  254.  
  255. -  To make autobuild not to complicate, the keywords MODULE, MACRO, MACROS,
  256. PROC and EXPORT must be on the beginning of the line! (No leading spaces or
  257. tabs.) If they are not at the beginning of the line, autobuild doesn't see
  258. them! On the other hand, if you use the keyword in other situations (e.g.
  259. MODULE after an OPT), make shure that it is NOT at the beginning of the
  260. line to make it invisible for autobuild!
  261.  
  262.  
  263.                           Copyright and Author
  264.                           ~~~~~~~~~~~~~~~~~~~~
  265.          Autobuild is (c) copyright 1994 Jan Hendrik Schulz
  266.  
  267.    Redistributing autobuild is allowed, as long as all files are included
  268. and unchanged, and as long as no profit (direct or indirect) is made by
  269. distributing autobuild!
  270.  
  271.    Autobuild is giftware, if you use it, send me something usefull (money,
  272. an Amiga 4000 or at least a postcard or an e-mail).
  273.  
  274.  [ After the first release I got only ONE e-mail (thanks Lionel). If really
  275. nobody else uses autobuild, I could send the next version directly to him!
  276. So, if you use it, send me an e-mail, a postcard or something else! ]
  277.  
  278.            My address:   Jan Hendrik Schulz
  279.                          Reinhard-Raffalt-Str. 41
  280.                          94036 Passau
  281.                          Germany
  282.  
  283.              Internet:   schulzj@fmi.uni-passau.de
  284.  
  285.  
  286.                              Disclaimer
  287.                              ~~~~~~~~~~
  288.     THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
  289.  APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
  290.  HOLDER AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
  291.  OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
  292.  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  293.  PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
  294.  PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE
  295.  COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
  296.  
  297.     IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
  298.  WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY REDISTRIBUTE THE
  299.  PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
  300.  GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
  301.  USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS
  302.  OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR
  303.  THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
  304.  PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
  305.  POSSIBILITY OF SUCH DAMAGES.
  306.  
  307.